import { isValid } from "cc";
import Foundation from "./Foundation";
import Gui from "./GuiMgr";

export default class BasePanel extends Foundation {
    public get data(): any { return this._data_$abc; }
    public setData(data: any) { this._data_$abc = data; }

    public onClickClose() {
        this.removeAllClock();
        if (isValid(this.node)) {
            Gui.closePanel(this.node.name);
        }
    }

    public onManualDestroy(mode: number) { this.node.destroy(); }

    //private
    ////
    private _data_$abc: any = null;
}